#pragma once
#include "CaelumInternal.h"
#include "CaelumExternal.h"
#include "ModelData.h"

#include <fstream>

namespace Caelum {
namespace ModelData {

class OBJProcessor
{
private:
	void skip_line(std::wistream &is);
	bool skip_comment(std::wistream &is);
	bool process_line(std::wistream &is);

	struct Vertex
	{
		uint VertID;
		uint TexCoordID;
		uint NormalID;
	};

	struct Face
	{
		std::vector<Vertex *> mVertices;
	};

	struct SubObject
	{
		std::wstring mName;

		std::vector<Vector3*> mVertPositions;
		std::vector<Vector3*> mVertTexCoords;
		std::vector<Vector3*> mVertNormals;

		std::vector<Face *> mFaces;

		//Material *mMat;
	};
	std::list<SubObject*> mObjects;
	SubObject *mCurObject;

	std::vector<std::wstring> mMaterialPaths;
protected:

public:
	OBJProcessor(std::wstring Path);
	~OBJProcessor() { }

	Model *GetModel() { return 0; }
};

}
}